% NOTE: this script is deprecated and should not be used in the sensor
%       matching process. You may want to directly compute the conditional
%       matrix via 'buildConditionalMatrix.m'

dist_rel = dist_rel_AB;
dist_12  = dist;
len1 = 14;
len2 = 27;

for row=2:size(dist_rel,1),
    a1 = ceil((row-1)/len1);
    a2 = mod((row-2), len1) + 1;
    
    for col=2:size(dist_rel,2),
        b1 = ceil((col-1)/len2);
        b2 = mod((col-2), len2) + 1;
        
        dist_uni{row,col} = dist_rel{row,col} + 0.3*dist_12(a1,b1) + 0.3*dist_12(a2,b2);
    end
end

dist_uni(1,:) = dist_rel(1,:);
dist_uni(:,1) = dist_rel(:,1);